package com.weishi.pay;


import javax.annotation.PostConstruct;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import com.weishi.frame.common.config.DruidConfig;
import com.weishi.frame.common.config.MybatisConfig;
import com.weishi.frame.common.config.RedisConfig;
import com.weishi.pay.api.exception.PayErrors;
import com.weishiinfo.commons.exception.rpc.RemoteCallExceptionConfiguration;
import com.weishiinfo.commons.exception.translate.ExceptionErrorCodeRegistar;
import com.weishiinfo.commons.exception.translate.ExceptionTranslatorConfiguration;

@Configuration
@MapperScan(basePackages = "com.weishi.pay.dao.mapper")
@Import({RedisConfig.class, MybatisConfig.class, DruidConfig.class,ExceptionTranslatorConfiguration.class,RemoteCallExceptionConfiguration.class})
public class ApplicationConfiguration {

	@Autowired
	ExceptionErrorCodeRegistar errorCodeRegistar;
	
	@PostConstruct
	public void registarError() {
		errorCodeRegistar.registerErrorCode(PayErrors.class);
	}

}
